#ifndef __THREAD_H_
#define __THREAD_H_

#include <pthread.h>
#include <functional>

namespace ln{

using ThreadCallBack = std::function<void()>;

class Thread{
public:
    Thread(ThreadCallBack && cb);
    ~Thread();
    void start();
    void join();

private:
    static void *start_routine(void *);

private:
    pthread_t      _pthid;
    bool           _isRunning;
    ThreadCallBack _cb;
};

}//end of namespace ln

#endif

